package com.myapplication.dialog;

import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.myapplication.zhou.alldemo.R;

/**
 * Created by 11065 on 2016/7/19.
 */
public class LoadingDialog {

    public static AlertDialog.Builder showDialog(Context context, String message){
        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        View view = LayoutInflater.from(context).inflate(R.layout.dialog_loading,null);
        TextView textView = (TextView) view.findViewById(R.id.textView_title);
        textView.setText(Html.fromHtml(message));
        LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.MATCH_PARENT);
        view.setLayoutParams(params);
        builder.setView(view);
        return builder;
    }
}
